<?php

namespace app\admin\model\dahui;

use think\Model;

class Newtk extends Model
{
    // 表名
    protected $name = 'dahui_newtk';
    
    // 自动写入时间戳字段
    protected $autoWriteTimestamp = false;

    // 定义时间戳字段名
    protected $createTime = false;
    protected $updateTime = false;
    
    // 追加属性
    protected $append = [
        'tkxzt_text',
        'refundornot_text',
        'idcardstate_text'
    ];
    

    
    public function getTkxztList()
    {
        return ['待初审' => __('待初审'),'待终审' => __('待终审'),'已终审' => __('已终审'),'' => __('')];
    }     

    public function getRefundornotList()
    {
        return ['未退款' => __('未退款'),'已退款' => __('已退款'), '退款失败' => __('退款失败'),'' => __('')];
    }     

    public function getIdcardstateList()
    {
        return ['正确' => __('正确'),'错误' => __('错误'), '重复' => __('重复')];
    }     


    public function getTkxztTextAttr($value, $data)
    {        
        $value = $value ? $value : (isset($data['tkxzt']) ? $data['tkxzt'] : '');
        $list = $this->getTkxztList();
        return isset($list[$value]) ? $list[$value] : '';
    }


    public function getRefundornotTextAttr($value, $data)
    {        
        $value = $value ? $value : (isset($data['refundornot']) ? $data['refundornot'] : '');
        $list = $this->getRefundornotList();
        return isset($list[$value]) ? $list[$value] : '';
    }


    public function getIdcardstateTextAttr($value, $data)
    {        
        $value = $value ? $value : (isset($data['idcardstate']) ? $data['idcardstate'] : '');
        $list = $this->getIdcardstateList();
        return isset($list[$value]) ? $list[$value] : '';
    }




}
